package com.day0422.AnimalTest;/*
 * @创建者：黄苟苟
 * @创建时间：2021/4/23   14:40
 * @Description描述
 **/

public class AnimalTest {
    public static void main(String[] args) {
        //非多态演示
        System.out.println("------非多态演示----------");
        Cat cat=new Cat();
        cat.cry();
        Dog dog=new Dog();
        dog.cry();
        //多态演示
        System.out.println("---------多态演示----------");
        Animal animal=new Cat();
        animal.cry();
        animal=new Dog();
        animal.cry();
        System.out.println();
        //多重多态演示
        System.out.println("---------多重多态演示----------");
        Master master=new Master();
        master.feed(new Dog(),new Bone());
        master.feed(new Cat(),new Fish());

    }
}
